package ace.module.account.core.impl.api.impl;

import ace.cmp.core.model.R;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.common.core.impl.api.impl.SdkApiImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import ace.module.account.core.impl.api.impl.IamAccountProfileApiImpl;
import ace.module.account.core.impl.dao.entity.IamAccountProfile;
import ace.module.account.api.model.dto.IamAccountProfileDto;
import ace.module.account.core.impl.manager.IamAccountProfileManager;
import ace.module.account.api.IamAccountProfileApi;


/**
 * 账户个人资料 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class IamAccountProfileApiImpl
	extends SdkApiImpl<IamAccountProfile, Long, IamAccountProfileDto, IamAccountProfileManager>
	implements IamAccountProfileApi {

	private final IamAccountProfileManager iamAccountProfileManager;

	@Override
	public R<IamAccountProfileDto> getByAccountId(Long accountId) {
		IamAccountProfileDto result = iamAccountProfileManager.getDtoByAccountIdAndDeleteFlagIsFalse(accountId);
		return R.ok(result);
	}
}
